

//=============================================================================
// Game_Map
//=============================================================================

Yanfly.isPreventScreenJittering = function() {
    if (Utils.RPGMAKER_VERSION && Utils.RPGMAKER_VERSION >= '1.3.4') return false;
    return true;
  };
  
  if (Yanfly.isPreventScreenJittering()) {
  
  Game_Map.prototype.displayX = function() {
      return parseFloat(Math.floor(this._displayX *
        this.tileWidth())) / this.tileWidth();
  };
  
  Game_Map.prototype.displayY = function() {
      return parseFloat(Math.floor(this._displayY *
        this.tileHeight())) / this.tileHeight();
  };
  
  }; // Yanfly.isPreventScreenJittering
  
  Game_Map.prototype.adjustX = function(x) {
      if (this.isLoopHorizontal() && x < this.displayX() -
              (this.width() - this.screenTileX()) / 2) {
          return x - this.displayX() + $dataMap.width;
      } else {
          return x - this.displayX();
      }
  };
  
  Game_Map.prototype.adjustY = function(y) {
      if (this.isLoopVertical() && y < this.displayY() -
              (this.height() - this.screenTileY()) / 2) {
          return y - this.displayY() + $dataMap.height;
      } else {
          return y - this.displayY();
      }
  };
  
  Game_Map.prototype.updateEvents = function() {
      var group = this.events();
      var length = group.length;
      for (var i = 0; i < length; ++i) {
        var ev = group[i];
        if (ev) ev.update();
      }
      var group = this._commonEvents;
      var length = group.length;
      for (var i = 0; i < length; ++i) {
        var ev = group[i];
        if (ev) ev.update();
      }
  };
  
  Game_Map.prototype.updateVehicles = function() {
      var group = this._vehicles;
      var length = group.length;
      for (var i = 0; i < length; ++i) {
        var vehicle = group[i];
        if (vehicle) vehicle.update();
      }
  };